@extends('frontend.layout.base')

@section('body')
    @if(isset($banners))
        <div id="carousel-games-banner" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                @for($i=0;$i<count($banners);$i++)
                    <li data-target="#carousel-games-banner" data-slide-to="{{ $i }}"
                        class="@if($i==0) active @endif"></li>
                @endfor
            </ol>
            <div class="carousel-inner" role="listbox">
                @for($i=0;$i<count($banners);$i++)
                    <div class="item @if($i==0) active @endif">
                        <a href="{{ $banners[$i]->download_url }}">
                            <img class="img-banner" src="{{ $banners[$i]->poster }}" alt="{{ $banners[$i]->name }}">
                        </a>
                    </div>
                @endfor
            </div>
        </div>
    @endif
    <div class="row">
        <div class="col-xs-3 game-header">
            <a href="{{ url('games') }}">
                <img src="{{ asset('/images/icon-game-all.png') }}" class="img-circle" height="50">
            </a>

            <p>全部游戏</p>
        </div>
        <div class="col-xs-3 game-header">
            <a href="{{ url('games/latest') }}">
                <img src="{{ asset('/images/icon-game-html.png') }}" class="img-circle" height="50">
            </a>

            <p>最新</p>
        </div>
        <div class="col-xs-3 game-header">
            <a href="{{ url('games/hot') }}">
                <img src="{{ asset('/images/icon-game-hot.png') }}" class="img-circle" height="50">
            </a>

            <p>热门</p>
        </div>
        <div class="col-xs-3 game-header">
            <a href="{{ url('games/cat') }}">
                <img src="{{ asset('/images/icon-game-post.png') }}" class="img-circle" height="50">
            </a>

            <p>分类</p>
        </div>
    </div>


    <div class="row">
        <div class="panel panel-default panel-game">
            <div class="panel-heading">编辑推荐</div>
            <div class="panel-body">
                <div class="media">
                    <div class="media-body">
                        <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                        <ins class="adsbygoogle"
                             style="display:block"
                             data-ad-client="ca-pub-7985605624032654"
                             data-ad-slot="5574899289"
                             data-ad-format="auto"></ins>
                        <script>
                            (adsbygoogle = window.adsbygoogle || []).push({});
                        </script>
                    </div>
                </div>
                <hr/>
                @foreach($games as $game)
                    @include('frontend.games.partials.game')
                @endforeach
            </div>
        </div>
    </div>
@stop